/**************************************************************************************************
 * @file        os_filesystem.h
 * @brief       跨平台文件系统操作API封装，支持Windows、Linux、macOS等系统的文件操作功能
 * @details     提供统一的文件系统接口，包括文件读写、目录操作、文件列表获取等功能。
 *
 * @author      taoist.luo
 * @version     1.0.0
 * @date        2024-09
 *
 * Copyright (c) 2024 taoist.luo (https://gitee.com/harmonyluo(https://blog.csdn.net/harmonyluo))
 *
 * MIT License
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 *************************************************************************************************/
#pragma once

#include <string>

#include "containers/os_vector.h"
class os_filesystem
{
public:
    static bool file_exists(const std::string& path);
    static bool directory_exists(const std::string& path);
    static bool create_directory(const std::string& path);
    static std::string read_file(const std::string& file_path);
    static bool write_file(const std::string& file_path, const std::string& content);
    static bool remove_file(const std::string& path);
    static bool remove_directory(const std::string& path);
    static bool copy_file(const std::string& source, const std::string& dest);
    static os_vector<std::string> list_files(const std::string& directory);
    static std::string calculate_file_md5(const std::string& file_path);
    static std::string calculate_string_md5(const std::string& content);
    static os_vector<std::string> list_subdirectories(const std::string& path);
};